package com.cade.agriculturemall.view.tEXT;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.cade.agriculturemall.R;

import java.util.List;

/**
 * Created by Lobby on 2018/1/10.
 */

public class EditInspectionReportAdapter extends RecyclerView.Adapter<EditInspectionReportAdapter.ViewHolder> {
    private List<EditInspectionReportViewModel> mList;
    private LayoutInflater mInflater;
    private int SELECTION_LABEL = 1;
    private int RECOMMEND_LABEL = 2;
    private int SELECTION_TEXT = 3;
    private int RECOMMEND_TEXT = 4;
    private int CUSTOM_LABEL = 5;
//    @Override
//    public EditInspectionReportAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//        return null;
//    }

    @Override
    public void onBindViewHolder(EditInspectionReportAdapter.ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 0;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == SELECTION_LABEL) {//选择标签
            return new ViewHolder(mInflater.inflate(R.layout.p_selected_label_adapter_item, null));
        } else if (viewType == SELECTION_TEXT) {//选择文本
            return new ViewHolder(mInflater.inflate(R.layout.p_selected_label_adapter_item2, null));
        } else if (viewType == RECOMMEND_TEXT) {//推荐文本
            return new ViewHolder(mInflater.inflate(R.layout.p_selected_label_adapter_item3, null));
        }
//        else if (viewType==CUSTOM_LABEL){//自定义标签
//            return new ViewHolder(mInflater.inflate(R.layout.p_selected_label_adapter_item4, null));
//        }
        else {//推荐标签
            return new ViewHolder(mInflater.inflate(R.layout.p_patient_label_adapter_item, null));
        }
    }

    @Override
    public int getItemViewType(int position) {
        if (mList.get(position).getKey() == "") {
            return SELECTION_LABEL;
        } else if (mList.get(position).getKey() == "a") {
            return SELECTION_TEXT;
        } else if (mList.get(position).getKey() == "b") {
            return RECOMMEND_TEXT;
        } else if (mList.get(position).getKey() == "c") {
            return CUSTOM_LABEL;
        } else {
            return RECOMMEND_LABEL;
        }
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        private TextView mTextView;

        public ViewHolder(View itemView) {
            super(itemView);
            mTextView = (TextView) itemView.findViewById(R.id.p_patientLabel_adapter_bt);
        }
    }
}
